<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:birt="http://jsf4birt.components"
	template="/templates/template.xhtml">
	<ui:define name="body">

		<h:outputText value="#{indicatorsMonitoringController.onload}"></h:outputText>

		<h:form id="x">
			<div align="center">
				<rich:panel style="background: transparent">
					<h:panelGrid columns="6" width="100%">
						<h:outputText value="Departamento" />
						<h:selectOneMenu
							value="#{indicatorsMonitoringController.departamento}"
							styleClass="cmbForm">
							<f:selectItem itemLabel="--seleccione--" itemValue="00" />
							<f:selectItems value="#{indicatorsMonitoringController.listaDep}" />
							<a4j:support event="onchange"
								action="#{indicatorsMonitoringController.cargaProvincias}"
								reRender="cmbProv,cmbDist,cmbSede" />
						</h:selectOneMenu>
						<h:outputText value="Provincia" />
						<h:selectOneMenu id="cmbProv"
							value="#{indicatorsMonitoringController.provincia}"
							styleClass="cmbForm">
							<f:selectItem itemLabel="--seleccione--" itemValue="00" />
							<f:selectItems
								value="#{indicatorsMonitoringController.listaProv}" />
							<a4j:support event="onchange"
								action="#{indicatorsMonitoringController.cargaDistrito}"
								reRender="cmbDist" />
						</h:selectOneMenu>
						<h:outputText value="Distrito" />
						<h:selectOneMenu id="cmbDist"
							value="#{indicatorsMonitoringController.distrito}"
							styleClass="cmbForm">
							<f:selectItem itemLabel="--seleccione--" itemValue="00" />
							<f:selectItems value="#{indicatorsMonitoringController.listaDis}" />
							<a4j:support event="onchange"
								action="#{indicatorsMonitoringController.cargaComite}"
								reRender="cmbComite" />
						</h:selectOneMenu>
						<rich:spacer height="10px" />
						<rich:spacer />
						<rich:spacer />
						<rich:spacer />
						<rich:spacer />
						<rich:spacer />
						<h:outputText value="Sede" />
						<h:selectOneMenu id="cmbSede"
							value="#{indicatorsMonitoringController.sede}"
							styleClass="cmbForm">
							<f:selectItem itemLabel="--seleccione--" itemValue="000" />
							<f:selectItems
								value="#{indicatorsMonitoringController.listaSede}" />
						</h:selectOneMenu>
						<h:outputText value="Comite" />
						<h:selectOneMenu id="cmbComite"
							value="#{indicatorsMonitoringController.comite}"
							styleClass="cmbForm">
							<f:selectItem itemLabel="--seleccione--" itemValue="000" />
							<f:selectItems
								value="#{indicatorsMonitoringController.listaComite}" />
						</h:selectOneMenu>
						<rich:spacer />
						<rich:spacer />
						<rich:spacer height="10px" />
						<rich:spacer />
						<rich:spacer />
						<rich:spacer />
						<rich:spacer />
						<rich:spacer />
						<h:outputText value="Ano" />
						<h:inputText value="#{indicatorsMonitoringController.anio}" />
						<h:outputText value="Mes" />
						<h:selectOneMenu id="cmbMes"
							value="#{indicatorsMonitoringController.mes}"
							styleClass="cmbForm">
							<f:selectItem itemLabel="--seleccione--" itemValue="00" />
							<f:selectItem itemLabel="Enero" itemValue="01" />
							<f:selectItem itemLabel="Febrero" itemValue="02" />
							<f:selectItem itemLabel="Marzo" itemValue="03" />
							<f:selectItem itemLabel="Abril" itemValue="04" />
							<f:selectItem itemLabel="Mayo" itemValue="05" />
							<f:selectItem itemLabel="Junio" itemValue="06" />
							<f:selectItem itemLabel="Julio" itemValue="07" />
							<f:selectItem itemLabel="Agosto" itemValue="08" />
							<f:selectItem itemLabel="Septiembre" itemValue="09" />
							<f:selectItem itemLabel="Octubre" itemValue="10" />
							<f:selectItem itemLabel="Noviembre" itemValue="11" />
							<f:selectItem itemLabel="Diciembre" itemValue="12" />
						</h:selectOneMenu>
					</h:panelGrid>
					<rich:spacer height="30px" />
					<a4j:commandButton value="Generar Reporte"
						action="#{indicatorsMonitoringController.generarReporte()}"
						reRender="panelReport" oncomplete="showDiv()" type="button"/>
				</rich:panel>
			</div>

			<rich:spacer height="20px" />
			<div align="center" style="height: 0px">
				<h:panelGroup id="panelReport" style="height:0px">
					<a4j:outputPanel style="visibility:hidden">
						<birt:birtWrapper
							reportDesign="/reports/indicatorsMonitoring.rptdesign"
							id="report" />
					</a4j:outputPanel>
				</h:panelGroup>
			</div>
		</h:form>



		<div id="es" align="center">

			<h:panelGrid id="panelboton" columns="1" width="10%" border="0"
				style="align:center;">


				<h:graphicImage value="/images/pdf_ico.jpg"
					onclick="JSF4Actuate.pdf('x:report')" style=" align:center" />
				<h:graphicImage value="/images/excel_ico.jpg"
					onclick="JSF4Actuate.xls('x:report')" rendered="false" />
				<h:graphicImage value="/images/word_ico.gif"
					onclick="JSF4Actuate.doc('x:report')" rendered="false" />

			</h:panelGrid>
		</div>
		<rich:effect name="showDiv" for="es" type="Appear"/>
		<rich:effect name="hideDiv" for="es" type="Fade" />
		<script type="text/javascript">
		hideDiv({duration:0.0});
		</script>
		<a4j:status id="idwait" onstart="#{rich:component('wait')}.show()"
			onstop="#{rich:component('wait')}.hide()" />
		<rich:modalPanel id="wait" autosized="true" width="100" height="40"
			moveable="false" resizeable="false">
			<h:graphicImage value="../images/spinner.gif" />
			<h:outputText value="Procesando..." />
		</rich:modalPanel>
	</ui:define>

</ui:composition>